#pragma once

#include <iostream>
#include <string>

#include "mysqlx/xdevapi.h"

#include "co/co/pool.h"

namespace gd__ {
    struct connPoolConf
    {
        static constexpr int port {33060};
        static constexpr char const * host {"localhost"};
        static constexpr char const * user {"root"};
        static constexpr char const * pwd {"1515"};
        static constexpr char const * db {"gddb"};
        static constexpr char const * tb {"logtb"};

        static inline co::Pool connPool {
            [] () -> void * {
                return static_cast<void*>(new mysqlx::Session(host, port, user, pwd));
            }, 
            [](void * sess) {
                static_cast<mysqlx::Session*>(sess)->close();
            }
        };
    };
}
